package com.fengpt.shardingjdbc.web;

import com.fengpt.shardingjdbc.dto.User;
import com.fengpt.shardingjdbc.service.UserService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

import java.util.List;

/**
 * @author fengpt
 * @createTime 2020年04月02日 11:32:00
 */
@RestController
public class UserController {

    @Autowired
    UserService userService;
    @GetMapping("/query")
    public User findUserById(@RequestParam("id") Long id) {
            return userService.findUserById(id);
    }

    @PostMapping("/querys")
    public List<User> findUserList(@RequestBody  List<Long> ids) {
        return userService.findUserList(ids);
    }

}
